Misc minor distracting stupid stuff to placate MSVC.
authorrobertl <robertl>
Fri, 7 Aug 2009 05:00:52 +0000 (05:00 +0000)
committerrobertl <robertl>
Fri, 7 Aug 2009 05:00:52 +0000 (05:00 +0000)
defs.h
delbin.c
mtk_logger.c
skytraq.c
v900.c

diff --git a/defs.h b/defs.h
index 85f1f863310988608b5d3f0d6fdcb9362c7d84cc..89a24559920dbb1548dfdf3fb39a05e49a166d1f 100644 (file)
--- a/defs.h
+++ b/defs.h
 #  if _MSC_VER
 #    pragma warning(disable:4244)
 #  endif
+#if !defined _CRT_SECURE_NO_DEPRECATE
 #  define _CRT_SECURE_NO_DEPRECATE 1
 #endif
+#endif
 
 /* Pathname separator character */
 #if __WIN32__
index 4dde83be836141bd2e3082919005cc0f8f5f596f..760892e9faeb5abfef2119e1768a4be9bbeee439 100644 (file)
--- a/delbin.c
+++ b/delbin.c
@@ -2150,6 +2150,11 @@ ff_vecs_t delbin_vecs = {
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <setupapi.h>
+// If hidsdi.h is not found, you need to download the Windows Driver Kit, 
+// from http://www.microsoft.com/whdc/Devtools/wdk/default.mspx
+// You need to install 'build environments' and 'tools' from the SDK and
+// follow the instructions in the Install.html to get MSVC to find the right
+// headers and libraries.
 #include <hidsdi.h>
 
 static HANDLE hid_handle;
index 4b29bf0f56b009e8f3f05e68a3a5f8d1f25724f6..32fd76a3c7ee78961c240c1a42ccd9640c7f2a52 100644 (file)
@@ -465,7 +465,7 @@ static void mtk_read(void){
   unsigned char crc, *data = NULL;
   int cmdLen, j, bsize, i, len, ff_len, null_len, rc, init_scan, retry_cnt, log_enabled;
   unsigned int line_size, data_size, data_addr, addr, addr_max;
-  long dsize, dpos = 0;
+  unsigned long dsize, dpos = 0;
   FILE *dout;
   char *fusage = NULL;
 
index e463b5fd8eaa176abc39e185a065b13c702b8869..8918d1c3ebae78e0a8cd5eebfee0ededbce7f636 100644 (file)
--- a/skytraq.c
+++ b/skytraq.c
@@ -112,6 +112,7 @@ rd_char(int *errors)
                }
        }
        fatal(MYNAME ": Too many read errors on serial port\n");
+    return -1;
 }
 
 static int
@@ -455,7 +456,7 @@ skytraq_get_log_buffer_status(gbuint32 *log_wr_ptr, gbuint16 *sectors_free, gbui
 }
 
 /* reads 32-bit "middle-endian" fields */
-static unsigned int me_read32(const void *p) {
+static unsigned int me_read32(const unsigned char *p) {
  return ((unsigned)be_read16(p+2) << 16) | ((unsigned)be_read16(p));
 }
 
@@ -821,7 +822,7 @@ skytraq_read_tracks(route_head *track)
        int i, t, s, rc, got_bytes;
        int read_at_once = MAX(atoi(opt_read_at_once), 1);
        int sectors_read, multi_read_supported = 1;
-       gbuint8 *buffer;
+       gbuint8 *buffer = NULL;
 
        state_init(&st);
        st.route_head = track;
diff --git a/v900.c b/v900.c
index ea2423d4742be579e9b6d88e3769485f773969d0..f926e7be0e730a2959261ce8ad6262cb400d6949 100644 (file)
--- a/v900.c
+++ b/v900.c
@@ -351,8 +351,9 @@ Advanced mode: INDEX,TAG,DATE,TIME,LATITUDE N/S,LONGITUDE E/W,HEIGHT,SPEED,HEADI
                        track_add_wpt(track, wpt);
                if(line.bas.common.tag != 'T')
                {
+                       waypoint *wpt2;
                        assert(line.bas.common.tag == 'C' || line.bas.common.tag == 'V');
-                       waypoint *wpt2 = waypt_dupe(wpt);
+                       wpt2 = waypt_dupe(wpt);
                        if(line.bas.common.tag == 'V')  // waypoint with voice recording?
                        {
                                char vox_file_name[sizeof(line.adv.vox)+5];